<?php

use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateCompanyDepartmentTable extends Migration{
    /**
     * 作者 柯良志
     * 企业部门 company_department
     * 添加时间 2016-11-1
     */
    public function up(){
        /** 企业部门表 company_department   **/
        Schema::create('company_department', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('uid')->unsigned()->index('uid')->default(0)->comment('所属企业用户id');
            $table->integer('com_id')->unsigned()->index('com_id')->default(0)->comment('所属企业id');
            $table->string('name', 60)->default('')->comment('部门名称');
            $table->string('contacts', 60)->default('')->comment('联系人');
            $table->string('mobile', 12)->default('')->comment('手机');
            $table->string('phone',20)->default('')->comment('座机电话');
            $table->string('fax',20)->default('')->comment('传真');
            $table->string('email',60)->default('')->comment('电子邮件');
            $table->timestamps();
        });
        /** 企业相册表 company_photo   **/
        Schema::create('company_photo', function (Blueprint $table) {
            $table->engine = 'MyISAM';
            $table->increments('id')->unsigned()->comment('自动增长主键');
            $table->integer('uid')->unsigned()->index('uid')->default(0)->comment('所属企业用户id');
            $table->integer('com_id')->unsigned()->index('com_id')->default(0)->comment('所属企业id');
            $table->string('file',255)->default('')->comment('图片文件');
            $table->text('remark')->default('')->comment('备注');
            $table->timestamps();
        });
    }

    /**
     * 作者 柯良志
     * 屏蔽企业表
     * 添加时间 2016-11-1
     */
    public function down(){
        Schema::drop('company_department');
        Schema::drop('company_photo');
    }
}
